#pragma once

#include "Muzzy A Wrappers\DirectX.h"

class Shaders;

class Geometry
{
public:
	struct Vertex
	{
		int			texCoordindex;
		Vector3		position;
	};
	
private:
	friend class ImageManager;

	IDirect3DTexture9			*m_pTexture;
	IDirect3DVertexBuffer9		*m_pVertBuff;
	IDirect3DVertexDeclaration9	*m_pVertDecl;
	IDirect3DIndexBuffer9		*m_pIndexBuff;
	
	float		m_fRotation;
	Color		m_ColorMask;
	Vector2		m_vTexCoords[4];

	unsigned	m_nImageWidth;	// Width of the actual texture
	unsigned	m_nImageHeight; // Height of the actual texture
	float		m_fWidth;		// Width of the geometry
	float		m_fHeight;		// Height of the geometry

public:
	Geometry(void);
	virtual ~Geometry(void);

	void Render(const Matrix &mTransform);

	///////////////////////////////////////////////////////////////////
	// Accessors and Mutators
	float		getWidth()				const	{ return m_fWidth; }
	float		getHeight()				const	{ return m_fHeight; }
	unsigned	getImageWidth()			const	{ return m_nImageWidth; }
	unsigned	getImageHeight()		const	{ return m_nImageHeight; }
	float		getRotation()			const	{ return m_fRotation; }
	Color		getColor()				const	{ return m_ColorMask; }
	void		setRotation(float rot)			{ m_fRotation = rot; }
	void		setColor(Color color)			{ m_ColorMask = color; }
	void		setSrcRect(const RECT &srcRect);
	///////////////////////////////////////////////////////////////////

private:
	Shaders *pShaders;
};

